﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeployGames.TweenEngine.equations
{
    public abstract class Quart : TweenEquation
    {
        public static QuartIN IN = new QuartIN();
        public static QuartOUT OUT = new QuartOUT();
        public static QuartINOUT INOUT = new QuartINOUT();

        #region QuartIN
        public class QuartIN : Quart
        {
            public override float compute(float t)
            {
                return t * t * t * t;
            }

            public override string ToString()
            {
                return "Quart.IN";
            }
        }
        #endregion

        #region QuartOUT
        public class QuartOUT : Quart
        {
            public override float compute(float t)
            {
                return -((t -= 1) * t * t * t - 1);
            }

            public override string ToString()
            {
                return "Quart.OUT";
            }
        }
        #endregion

        #region QuartINOUT
        public class QuartINOUT : Quart
        {

            public override float compute(float t)
            {
                if ((t *= 2) < 1) return 0.5f * t * t * t * t;
                return -0.5f * ((t -= 2) * t * t * t - 2);
            }

            public override string ToString()
            {
                return "Quart.INOUT";
            }
        }
        #endregion
    }
}
